<<<<<<< HEAD
const defaultState={
    productId:0,
    carts:[]
}

function product(state=defaultState,action){
    switch(action.type){
        case 'ADD_PRODUCT':
            if(state.indexOf(action.productId) !== -1){
            return state ;
            }
            return [
                ...state,
                action.productId
            ]
        default:
            return state;
        
    }
}

module.exports=product;
=======
const defaultstat=
    {
        id:''
    }
function product(state=defaultstat,action){
    console.log(action);
    switch(action.type){
        case('ADD'):
             return state;
             default:
                return state;
    }
}

    module.exports= product;
>>>>>>> 39a548eaace9e366499720bc30a0cbaa3eb5cd80
